import request from '@/utils/request'

// 工单搜索
export const searchstateApi = (params) => {
  return request({
    url: '/api/task-service/task/search',
    params
  })
}

// 工单状态列表
export const taskstateApi = () => {
  return request({
    url: '/api/task-service/task/allTaskStatus'
  })
}

// 获取工单详情
export const getTaskApi = (id) => {
  return request({
    url: `/api/task-service/task/taskInfo/${id}`
  })
}

// 获取所有工单类型
export const allTaskApi = () => {
  return request({
    url: '/api/task-service/taskType/list'
  })
}

// 根据售货机获取运营人员列表
export const operatorListApi = (id) => {
  return request({
    url: `/api/user-service/user/operatorList/${id}`
  })
}

// 创建工单
export const createdApi = (data) => {
  return request({
    url: '/api/task-service/task/create',
    method: 'POST',
    data
  })
}

// 取消工单
export const delWorkApi = (data) => {
  return request({
    url: `/api/task-service/task/cancel/${data.taskId}`,
    method: 'POST',
    data
  })
}
